package com.longxi.tianjintianbao.ui.activity.repair_already;

import android.content.Intent;
import android.support.v4.view.ViewPager;

import com.flyco.tablayout.SlidingTabLayout;
import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.repair_already.AlreadyRepairListAtPresenter;
import com.longxi.tianjintianbao.ui.view.repair_already.IAlreadyRepairListAtView;

import butterknife.BindView;

public class AlreadyRepairListActivity extends BaseActivity<IAlreadyRepairListAtView, AlreadyRepairListAtPresenter> implements IAlreadyRepairListAtView {

    private final String TAG = "AlreadyRepairListActivity";

    @BindView(R.id.tabLayout)
    SlidingTabLayout mTabLayout;
    @BindView(R.id.vp)
    ViewPager mViewPager;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_general_tab;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initViewPager();
    }

    @Override
    public void initListener() {
        super.initListener();
    }

    @Override
    protected AlreadyRepairListAtPresenter createPresenter() {
        return new AlreadyRepairListAtPresenter(this);
    }

    @Override
    public SlidingTabLayout getTabLayout() {
        return mTabLayout;
    }

    @Override
    public ViewPager getViewPager() {
        return mViewPager;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(RESULT_OK != resultCode){
            return;
        }
        mPresenter.refreshFragmentUi();
    }
}
